package edu.neu.chenhan.fragment.cooperation;

import android.os.Bundle;
import android.text.style.AlignmentSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import edu.neu.chenhan.R;
import edu.neu.chenhan.model.StandardDetail;

public class StandardDetailFragment extends Fragment {

    private TextView tvStandardTitle, tvStandardScope, tvStandardTechnicalContent;
    private StandardDetail standard;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_standard_detail, container, false);

        tvStandardTitle = view.findViewById(R.id.standard_title);
        tvStandardScope = view.findViewById(R.id.standard_scope);
        tvStandardTechnicalContent = view.findViewById(R.id.standard_technical_content);

        Bundle args = getArguments();
        if (args != null) {
            standard = (StandardDetail) args.getSerializable("standard");
            if (standard != null) {
                tvStandardTitle.setText(standard.getName());
                tvStandardScope.setText(standard.getScope());
                tvStandardTechnicalContent.setText(standard.getTechnicalContent());
            }
        }

        return view;
    }
}